import { createRouter, createWebHistory, createWebHashHistory } from "vue-router";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      redirect: "/login",
    },
    {
      path: "/login",
      name: "login",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("../views/login.vue"),
    },
    {
      path: "/home",
      name: "home",
      component: () => import("../views/home.vue"),
      children: [
        {
          path: "/surf",
          name: "surf",
          component: () => import("../views/surf.vue"),
        },
        {
          path: "/award",
          name: "award",
          component: () => import("../views/award.vue"),
        },
        {
          path: "/me",
          name: "me",
          component: () => import("../views/me.vue"),
        },
      ],
    },
  ],
});

export default router;
